package model

type Inventory struct {
	BaseModel
	Goods   int32 `gorm:"type:int;index"` //商品id
	Stocks  int32 `gorm:"type:int"`       //库存
	Version int32 `gorm:"type:int"`       //分布式锁的乐观锁
	//Freeze  int32 `gorm:"type:int"`       //冻结库存
}

// ttc仓库服务：出库单
type Delivery struct {
	Goods   int32  `gorm:"type:int;index"`
	Nums    int32  `gorm:"type:int"`
	OrderSn string `gorm:"type:varchar(200)"`
	Status  string `gorm:"type:varchar(50)"` //1.表示等待支付  2.表示支付成功  3.失败
}
type StockSellDetail struct {
	OrderSn string          `gorm:"type:varchar(200);index:idx_order_sn,unqiue;"`
	Status  int32           `gorm:"type:int"` //1.表示已扣减  2.表示已归还  3.失败
	Detail  GoodsDetailList `gorm:"type:varchar(1000)"`
}

func (StockSellDetail) TableName() string {
	return "stock_sell_detail"
}

type GoodsDetail struct {
	Goods int32
	Num   int32
}
